package cn.jack.javalib.player;

/**
 * Created by chengyinggen on 2019/2/26.
 */
public class PlayState extends PlayerState {

    public PlayState(IPlayer mPlayer) {
        super(mPlayer);
    }

    @Override
    public void handle(int action) {
        switch (action) {
            case PAUSE:
                mPlayer.pause();
                mPlayer.setState(new PauseState(mPlayer));
                break;
            case STOP:
                mPlayer.stop();
                mPlayer.setState(new StopPlay(mPlayer));
                break;
            default:
                throw new IllegalArgumentException("error");
        }
    }
}
